#ifndef TUSER_H
#define TUSER_H

#include "TRole.h"
#include <QDateTime>

class TUser
{
// Member
private:
	int _id;
	QString _loginName;
	QString _loginPassword;
	QString _name;
	QString _email;
	TRolePointer _role;
	bool _active;
	QDateTime _updateTime;
	QDateTime _createTime;
	QDateTime _latestLoginTime;

// Method
public:
    TUser();
    virtual ~TUser();

// Getter and Setter
public:
    bool getActive() const
    {
        return _active;
    }

    QDateTime getCreateTime() const
    {
        return _createTime;
    }

    QString getEmail() const
    {
        return _email;
    }

    int getId() const
    {
        return _id;
    }

    QDateTime getLatestLoginTime() const
    {
        return _latestLoginTime;
    }

    QString getLoginName() const
    {
        return _loginName;
    }

    QString getLoginPassword() const
    {
        return _loginPassword;
    }

    QString getName() const
    {
        return _name;
    }

    TRolePointer getRole() const
    {
        return _role;
    }

    QDateTime getUpdateTime() const
    {
        return _updateTime;
    }

    void setActive(bool _active)
    {
        this->_active = _active;
    }

    void setCreateTime(QDateTime _createTime)
    {
        this->_createTime = _createTime;
    }

    void setEmail(QString _email)
    {
        this->_email = _email;
    }

    void setId(int _id)
    {
        this->_id = _id;
    }

    void setLatestLoginTime(QDateTime _latestLoginTime)
    {
        this->_latestLoginTime = _latestLoginTime;
    }

    void setLoginName(QString _loginName)
    {
        this->_loginName = _loginName;
    }

    void setLoginPassword(QString _loginPassword)
    {
        this->_loginPassword = _loginPassword;
    }

    void setName(QString _name)
    {
        this->_name = _name;
    }

    void setRole(TRolePointer _role)
    {
        this->_role = _role;
    }

    void setUpdateTime(QDateTime _updateTime)
    {
        this->_updateTime = _updateTime;
    }

};

typedef QSharedPointer<TUser> TUserPointer;

#endif // TUSER_H
